package com.yckj.day05;

public class Demo1 {
    public static void main(String[] args) {
		long res = factorial(10);
		System.out.println(res);
	}
    /**
           * 求阶乘
     * @param n
     * @return
     */
    public static long factorial(int n) {
    	if(n == 1) {
    		return 1;
    	}else {
    		return factorial(n-1)*n;
    	}
    	
    }
}
